home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.5 KB | 156 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRgnShp.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRGNSHP_H
- #define FWRGNSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWDEBUG_H
- #include "FWDebug.h"
- #endif
-
- #ifndef FWSOMENV_H
- #include "FWSOMEnv.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CRegionShape
- //========================================================================================
-
- class FW_CRegionShape : public FW_CShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CRegionShape)
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CRegionShape(ODShape* odShape,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- FW_CRegionShape(const FW_CRegionShape& other);
- FW_CRegionShape(FW_CReadableStream& stream);
-
- virtual ~ FW_CRegionShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CRegionShape& operator=(const FW_CRegionShape& other);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_Fixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Transform -----
- virtual void Transform(Environment* ev, ODTransform* odTransform);
- virtual void InverseTransform(Environment* ev, ODTransform* odTransform);
-
- virtual void MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
- virtual void MoveShapeTo(FW_Fixed x, FW_Fixed y);
-
- virtual void Inset(FW_Fixed h, FW_Fixed v);
-
- // ----- Geometry -----
- virtual void GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
-
- // ----- Anchor Point -----
- virtual FW_CPoint GetAnchorPoint() const;
-
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& stream) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderRegion(FW_CGraphicContext& gc,
- ODShape* odShape,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- // ----- Getter/Setters -----
- void GetGeometry(ODShape* odShape) const; // returns a copy
- void SetGeometry(ODShape* odShape); // use a copy
-
- ODShape* GetODShape() const; // return fODShape
- void AdoptODShape(ODShape* newODShape); // Doesn't use a copy
- ODShape* OrphanODShape(); //
-
- private:
- void DisposeODShape(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- ODShape *fODShape;
- };
-
- //========================================================================================
- // inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CRegionShape::GetODShape
- //----------------------------------------------------------------------------------------
- inline ODShape* FW_CRegionShape::GetODShape() const
- {
- return fODShape;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CRegionShape::GetGeometry
- //----------------------------------------------------------------------------------------
- inline void FW_CRegionShape::GetGeometry(ODShape* odShape) const
- {
- FW_SOMEnvironment ev;
- odShape->CopyFrom(ev, fODShape); // [HLX] for now
- }
-
- #endif
-